.class public Lcom/zuiapps/sdk/analytics/api/ZMAnalyticsRestful;
.super Lcom/zuiapps/sdk/analytics/api/BaseRestful;
.source "ZMAnalyticsRestful.java"


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 21
    invoke-direct {p0}, Lcom/zuiapps/sdk/analytics/api/BaseRestful;-><init>()V

    return-void
.end method

.method public static postDataToServer(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Lcom/loopj/android/http/AsyncHttpClient;Lcom/zuiapps/sdk/analytics/api/MyJsonHttpResponseHandler;)V
    .registers 11
    .param p0, "context"    # Landroid/content/Context;
    .param p1, "userId"    # Ljava/lang/String;
    .param p2, "jsonStr"    # Ljava/lang/String;
    .param p3, "asyncHttpClient"    # Lcom/loopj/android/http/AsyncHttpClient;
    .param p4, "responseHandler"    # Lcom/zuiapps/sdk/analytics/api/MyJsonHttpResponseHandler;

    .prologue
    .line 24
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    .line 25
    .local v0, "reqMap":Ljava/util/Map;, "Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;"
    invoke-static {p1}, Lcom/zuiapps/sdk/analytics/helper/SecrHelper;->makeTokenByNice(Ljava/lang/String;)Lcom/zuiapps/sdk/analytics/helper/Token;

    move-result-object v1

    .line 26
    .local v1, "tk":Lcom/zuiapps/sdk/analytics/helper/Token;
    const-string v2, "nice_log_upload"

    invoke-interface {v0, v2, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 27
    const-string v2, "timestamp"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1}, Lcom/zuiapps/sdk/analytics/helper/Token;->getTimestamp()J

    move-result-wide v4

    invoke-virtual {v3, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ""

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-interface {v0, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 28
    const-string v2, "user_id"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1}, Lcom/zuiapps/sdk/analytics/helper/Token;->getUid()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ""

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-interface {v0, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 29
    const-string v2, "signature"

    invoke-virtual {v1}, Lcom/zuiapps/sdk/analytics/helper/Token;->getSecr()Ljava/lang/String;

    move-result-object v3

    invoke-interface {v0, v2, v3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 30
    const-string v2, "ZM-analytics-sdk"

    const-string v3, "Android 1.0"

    invoke-virtual {p3, v2, v3}, Lcom/loopj/android/http/AsyncHttpClient;->addHeader(Ljava/lang/String;Ljava/lang/String;)V

    .line 31
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "reqMap="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/zuiapps/sdk/analytics/util/ZMLogUtil;->e(Ljava/lang/String;)V

    .line 32
    const-string v2, "http://zuimeia.com/api/log/upload/"

    new-instance v3, Lcom/loopj/android/http/RequestParams;

    invoke-direct {v3, v0}, Lcom/loopj/android/http/RequestParams;-><init>(Ljava/util/Map;)V

    invoke-static {p0, v2, p3, v3, p4}, Lcom/zuiapps/sdk/analytics/api/ZMAnalyticsRestful;->loadDataPost(Landroid/content/Context;Ljava/lang/String;Lcom/loopj/android/http/AsyncHttpClient;Lcom/loopj/android/http/RequestParams;Lcom/zuiapps/sdk/analytics/api/MyJsonHttpResponseHandler;)V

    .line 33
    return-void
.end method
